<?php

namespace app\model\zs;

use think\Model;

class ZsTwActivityPlatform extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'tw_activity_platform';

    // 设置当前模型的数据库连接
    protected $connection = 'zs';

    const TYPE_FIRST_ORDER = 1;
    const TYPE_FREE_FEE = 2;

    const AUDIT_STATUS_WAIT = 0;
    const AUDIT_STATUS_PASS = 1;
    const AUDIT_STATUS_FAIL = 2;

    const STATUS_OFF = 0;
    const STATUS_ON = 1;

    /**
     * 类型对应文字
     *
     * @return array
     */
    public static function typeRels()
    {
        return [
            self::TYPE_FIRST_ORDER => '首单减',
            self::TYPE_FREE_FEE => '免配送费',
        ];
    }

    /**
     * 审核状态对应文字
     *
     * @return array
     */
    public static function auditStatusRels()
    {
        return [
            self::AUDIT_STATUS_WAIT => '待审核',
            self::AUDIT_STATUS_PASS => '审核通过',
            self::AUDIT_STATUS_FAIL => '审核拒绝',
        ];
    }

    /**
     * 状态对应文字
     *
     * @return array
     */
    public static function statusRels()
    {
        return [
            self::STATUS_OFF => '禁用',
            self::STATUS_ON => '启用',
        ];
    }
}
